package database

import (
	"WIKIHepler_PCR/logger"
	"database/sql"

	_ "github.com/mattn/go-sqlite3"
)

var (
	db  *sql.DB
	err error
)

func link() {
	db, err = sql.Open("sqlite3", "./wiki_PCR.db?parseTime=true")
	if err != nil {
		logger.GetLogger().PrintWarn("Can not open database!:" + err.Error())
	}
	logger.GetLogger().PrintInfo("Open database success!")
}

func close() {
	db.Close()
}
